package org.budo.redis.jdbc.driver.parser;

import org.budo.jdbc.driver.parser.SqlStatement;
import org.budo.support.lang.util.StringUtil;

/**
 * @author lmw
 */
public class RedisSqlStatement implements SqlStatement {
    private String sql;

    private String functionName;

    private String[] functionParameters;

    public RedisSqlStatement(String sql, String functionName, String[] functionParameters) {
        this.sql = sql;
        this.functionName = functionName;
        this.functionParameters = functionParameters;
    }

    public String getFunctionName() {
        return this.functionName;
    }

    public String[] getFunctionParameters() {
        return this.functionParameters;
    }

    @Override
    public String toString() {
        return super.toString() //
                + ", sql=" + this.sql //
                + ", functionName=" + this.functionName //
                + ", functionParameters=" + StringUtil.join(this.getFunctionParameters());
    }
}